package com.example.control

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import java.lang.StringBuilder

class SettingActivity : AppCompatActivity() {

    private val settingsList = ArrayList<String>()


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_setting)

        initSettings()

        val settingRecycler = findViewById<RecyclerView>(R.id.settingRecycler)

        val layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
        val adapter = SettingsAdapter(this, settingsList)

        settingRecycler.layoutManager = layoutManager
        settingRecycler.adapter = adapter
    }


    private fun initSettings(){
        settingsList.clear()
        settingsList.add(StringBuilder("Setting1").toString())
        settingsList.add(StringBuilder("Setting2").toString())
        settingsList.add(StringBuilder("Setting3").toString())
        settingsList.add(StringBuilder("Setting4").toString())
        settingsList.add(StringBuilder("Setting5").toString())
        settingsList.add(StringBuilder("Setting6").toString())
        settingsList.add(StringBuilder("Setting7").toString())
    }
}